#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>

int main(int argc, char const* argv[])
{
    int fd;

    fd = open("file", O_RDWR);
    if (fd < 0)
        perror("open error");
    close(fd);

    fd = open("file", O_RDWR);
    printf("fd is %d\n", fd);

    return 0;
}
